<template>
	<view class="qigua">
		<view class="input-content">
			<input type="text" class="inp" v-model="shuzi" placeholder="请随机输入一个数字">
		</view>
		<view class="start" @click="getData">
			<text>点击起卦</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				shuzi:''
			}
		},
		methods: {
			getData() {
				uni.showLoading({
					title: '加载中'
				})
			this.$api.xiaoliurenzhanbu({shuzi:this.shuzi}).then((res) => {
			
				if (res.errcode == 0) {
					uni.navigateTo({
						url: "/pages/xiaoliurenzhanbu/details?data=" + JSON.stringify(res.data)
					})
				} else {
					uni.showToast({
						title: res.errmsg,
						icon: 'none'
					})
				}
			})
			
			
			}
		}
	}
</script>

<style lang="scss">
	.qigua {
		width: 100%;
		text-align: center;
		.input-content{
			margin: 20px;
			border: 1px solid #dec4c4;
			border-radius: 20px;
			height: 30px;
			input{
				height: 30px;
			}
			
		}
		.start {
			width: 100%;
			text-align: center;

			text {
				width: 120px;
				display: inline-block;
				background-color: #e32616;
				font-size: 30rpx;
				color: #fff;
				padding: 10px;
				border-radius: $uni-border-radius-base;
				line-height: 15px;
				margin-top: 20px;
			}

		}

	}
</style>
